<template>
  <span>{{message}}</span>
</template>

<script setup>
import { ref, watch } from 'vue';
import api from "@/http/api";

const props = defineProps({
  ids: {
    type: String,
    default: ''
  },
});
const message = ref('');

const init = (ids) => {
  message.value = '';
  if (!ids) return;

  api.post("/business/organization/id-name", {ids: ids.split(',')}).then(res => {
    message.value = res.data;
  });
};

watch(() => props.ids, (data) => {
  init(data);
}, {immediate: true});
</script>